import {
    FETCH_THREAD_LIST_SUCCESS,
    CREATE_THREAD_SUCCESS
} from '../actions'


export default function(state = { resources: []}, action){
    switch(action.type) {
        case FETCH_THREAD_LIST_SUCCESS:
            return {...state, resources: action.response};
        case CREATE_THREAD_SUCCESS:
            return {...state, resources: [action.response, ...state.resources]}
        default:
            return state;
    }
}
